package com.dc.project.entity.map;

import com.dc.project.entity.po.TaskDetail;
import com.own.component.common.base.entity.BaseMap;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * TaskDetailMapVo
 *
 * @author chenxueli
 * @date 2025-03-08 15:11:52
 */
@Schema(title = "任务详情" + ConstantBeanSuffix.MAP_VO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class TaskDetailMapVo extends BaseMap<TaskDetail> implements Serializable {

    @Schema(title = "任务id")
    private Long taskId;

    @Schema(title = "标题")
    private String title;

    @Schema(title = "任务类型 1=根据自定义文件创建 2=根据模板生成")
    private Integer type;

    @Schema(title = "模板key")
    private String templateKey;

    @Schema(title = "附件id")
    private Long fileId;

    @Schema(title = "附件路径")
    private String filePath;

    @Schema(title = "解析状态 1=未开始 2=文件解析文本成功 3=文件解析文本失败 4=文件内容分析成功 5=文件内容分析失败")
    private Integer status;

    @Schema(title = "解析消息")
    private String parseMessage;

    /**
     * 构造方法
     *
     * @param entity 原对象
     */
    public TaskDetailMapVo(@NonNull TaskDetail entity) {
        super(entity);
        this.taskId = entity.getFkTaskId();
        this.title = entity.getTitle();
        this.type = entity.getType();
        this.templateKey = entity.getTemplateKey();
        this.fileId = entity.getFkFileId();
        this.filePath = entity.getFilePath();
        this.status = entity.getStatus();
        this.parseMessage = entity.getParseMessage();
    }

}
